export const copy = (text: string): Promise<void> => {
  return new Promise(resolve => {
    if (navigator.clipboard && window.isSecureContext) {
      navigator.clipboard.writeText(text).then(() => {
        resolve()
      });
    } else {
      document.execCommand('copy');
      resolve()
    }
  })
}
